import pandas as pd
df11 = pd.read_csv(r'C:\Users\Wang\Desktop\data\stock_small.csv')
df12 = pd.read_csv(r'C:\Users\Wang\Desktop\data\dividends_small.csv')
df2 = df12[df12['symbol'] == "IBM"]    #得到dividends_small中IBM所在行
df1 = df11[df11['stock_symbol'] == "IBM"]
df=pd.merge(df1,df2,left_on='stock_symbol',right_on='symbol')
df=df.iloc[:, [1, 2, 6]]
a=[]
for i in range(0,len(df),41):##意外出现bug，数据行重复了41次，故每隔41行取数据
    a.append(i)
file = df.iloc[a]
print(file)
